Chapter 2 Electricity profiles
This chapter provides electricity profiles and a R coding technique. Electricity profiles are illustrated to give an insight into profile behavior. R coding technique are given in order to understand the process flow and manage the big data obtained from several sources in the organization.
2.1 Initial settings
Before the project starts, packages are required as follows:
- A
tidyversepackage is a bunch of packages to handle with a data analysis (for more information click here). It consists of data manipulation and visualization as follows:- A
ggplot2package is for data visualization. - A
dplyrpackage is for data manipulation. - A
tidyrpackage is for data tidying. - A
readrpackage is for data import. - A
purrrpackage is for functional programming. - A
tibblepackage is a modern reimagining of the data.frame. - A
stringrpackage is for strings. - A
forcatspackage is for factors. - A
lubridatepackage is for date and time.
- A
- A
readxlpackage is used for read data from Excel into R. - A
scalespackage is applied to scale plots in the ggplot2 package. - A
gluepackage interprets strings literal. The package embeds R expressions and inserts into argument string. - A
knitrpackage is a lightweight API’s designed to give users full control of the output without heavy coding work. In this project, the package is used for making a HTML.
library(tidyverse) #For data manipulation
library(readxl) #For reading the excel sheet
library(scales)
library(glue)
library(knitr)
library(plotly)Theme and lines for figures are set in a variable named Themeline as follows:
theme_bw()function provides a black and white theme.theme()function applied for setting theme and line represented in plots.linepalette1andlinepalette1variables set line colors.
ThemeLine <-
theme_bw() +
theme(
panel.border=element_rect(fill=NA),
panel.grid.minor = element_line(color = NA),
# axis.title=element_text(size=5),
# axis.text.x = element_text(hjust=1,size = 10, angle = 0),
axis.line=element_line(colour="black"),
panel.background=element_rect(fill = "white"),
panel.grid.major.x=element_line(linetype="dashed",colour="grey",linewidth = 0.5),
panel.grid.major.y = element_blank(),
# panel.grid.major=element_blank(),
strip.background=element_rect(fill="white", colour="white"),
strip.text.x = element_text(size=10, colour = "black", angle = 0,face="bold"),
axis.text.x=element_text(size = 10,angle=45, vjust=0.9, hjust=1, margin = unit(c(t = 0.3, r = 0, b = 0, l = 0), "cm")),
axis.text.y=element_text(size = 10,margin = unit(c(t = 0, r = 0.3, b = 0, l = 0), "cm")),
legend.text = element_text(size = 10),
legend.title = element_text(size = 10),
axis.ticks.length=unit(-0.15,"cm")
)
linepalette1 <- c("#4DAF4A","#FF7F00","#377EB8","#E41A1C","#984EA3","#F781BF","#8DD3C7","#FB8072","#80B1D3","#FDB462","#B3DE69","#FCCDE5","#D9D9D9","#BC80BD","#CCEBC5","#FFED6F","#7f878f","#A65628","#FFFF33")
linepalette2 <- c("#E41A1C","#FF7F00","#377EB8","#B3DE69","#4DAF4A","#984EA3","#F781BF","#8DD3C7","#FB8072","#80B1D3","#FDB462","#FCCDE5","#D9D9D9","#BC80BD","#CCEBC5","#FFED6F","#7f878f","#A65628","#FFFF33")Lists are create to store variables.
2.2 The EGAT electrity sale profiles
2.2.2 The 2019 Provincial Electricity Authority (PEA) EGAT sale profiles
2.2.2.1 The 2019 PEA-R1 (Central region) EGAT sale profile
Read a profile data
profile <-
read_excel("raw_data/raw_data_profiles/02_Hourly Sale_NetGen_2019.xlsx",
sheet = "Load Curve",
range = "C3:E17523"
) %>%
select(datetime = `Date/Time`, PEA_R1) %>%
mutate(date = date(datetime),
time = format(as.POSIXct(datetime),"%H:%M:%S"),
year = year(datetime),
month = month(datetime),
day = day(datetime)) %>%
select(datetime, date, time, year, month, day, PEA_R1)| datetime | date | time | year | month | day | PEA_R1 |
|---|---|---|---|---|---|---|
| 2019-01-01 00:00:00 | 2019-01-01 | 00:00:00 | 2019 | 1 | 1 | 5036.982 |
| 2019-01-01 00:30:00 | 2019-01-01 | 00:30:00 | 2019 | 1 | 1 | 4907.355 |
| 2019-01-01 01:00:00 | 2019-01-01 | 01:00:00 | 2019 | 1 | 1 | 4929.126 |
| 2019-01-01 01:30:00 | 2019-01-01 | 01:30:00 | 2019 | 1 | 1 | 4793.341 |
| 2019-01-01 02:00:00 | 2019-01-01 | 02:00:00 | 2019 | 1 | 1 | 4789.811 |
maxv <- ceiling(max(profile$PEA_R1)) # Get a peak MW
minv <- floor(min(profile$PEA_R1)) # Get a min MW
energy <- sum(profile$PEA_R1)/2000 # Calculate the energy
peak_day <- profile %>% #Find a peak day
group_by(year) %>%
filter(PEA_R1 == max(PEA_R1)) %>%
pull(datetime)
min_day <- profile %>% #Find a peak day
group_by(year) %>%
filter(PEA_R1 == min(PEA_R1)) %>%
pull(datetime)
load_factor <- percent((energy*10^3)/(maxv*8760),
accuracy = 0.01,
decimal.mark = ".")
summary <- tibble(peak_day = peak_day,
min_day = min_day,
peak_mw = maxv,
min_mw = minv,
energy_gwh = energy,
load_factor = load_factor) | peak_day | min_day | peak_mw | min_mw | energy_gwh | load_factor |
|---|---|---|---|---|---|
| 2019-05-03 23:00:00 | 2019-01-01 12:00:00 | 11936 | 3293 | 80961.36 | 77.43% |
The 2019 electricity sale profile from EGAT to PEA-R1 is illustrated (see Figure 2.2).
profile_plot <-
ggplot() +
geom_line(data=profile,
aes(x = datetime,
y = PEA_R1,
group = month,
color = as.factor(month)),
show.legend = FALSE) +
ThemeLine +
labs(x = NULL,
y = "EGAT sale to PEA R1 (Central region) (MW)")+
scale_x_datetime(breaks=date_breaks("1 month"),
labels=date_format("%b %y")) +
scale_y_continuous(breaks = seq(0, round(maxv,-3),1000),
limits = c(0, round(maxv, -3))) +
scale_color_manual(values = linepalette1) +
geom_point(data=summary,
aes(x = peak_day, y = peak_mw))+
geom_text(data = summary,
aes(x = peak_day, y = round(maxv, -3)),
label = glue("Peak {maxv} MW \n@ {peak_day}"))+
geom_point(data=summary,
aes(x = min_day, y = min_mw))+
geom_text(data = summary,
aes(x = min_day, y = round(minv, -3)),
label = glue("Minimum {minv} MW \n@ {min_day}"),
hjust = 0,
vjust = 1.5)Figure 2.2: EGAT electricity sale profile to PEA-R1 in 2019.
outputfigure <- paste0(outfigdir, "pea_r1_central_egtsle_2019.png")
ggsave(profile_plot, file = outputfigure, dpi = 150, width = 15, height = 5, units = "in", limitsize = FALSE)
profiledata <- c(profiledata, list("pea_r1_central_egtsle_2019" = profile))
profilefigure <- c(profilefigure, list("pea_r1_central_egtsle_2019" = profile_plot))
summarydata <- c(summarydata, list("sum_pea_r1_central_egtsle_2019" = summary))2.2.2.2 The 2019 PEA-R2 (North Eastern region) EGAT sale profile
# Profile data ####
profile <-
read_excel("raw_data/raw_data_profiles/02_Hourly Sale_NetGen_2019.xlsx",
sheet = "Load Curve",
range = "C3:F17523"
) %>%
select(datetime = `Date/Time`, PEA_R2) %>%
mutate(date = date(datetime),
time = format(as.POSIXct(datetime),"%H:%M:%S"),
year = year(datetime),
month = month(datetime),
day = day(datetime)) %>%
select(datetime, date, time, year, month, day, PEA_R2) #%>%
# mutate(strdatetime = as.factor(strptime(glue("{year}-{month}-{day} {time}"), "%Y-%m-%d %H:%M:%S")))| datetime | date | time | year | month | day | PEA_R2 |
|---|---|---|---|---|---|---|
| 2019-01-01 00:00:00 | 2019-01-01 | 00:00:00 | 2019 | 1 | 1 | 1459.520 |
| 2019-01-01 00:30:00 | 2019-01-01 | 00:30:00 | 2019 | 1 | 1 | 1415.846 |
| 2019-01-01 01:00:00 | 2019-01-01 | 01:00:00 | 2019 | 1 | 1 | 1350.192 |
| 2019-01-01 01:30:00 | 2019-01-01 | 01:30:00 | 2019 | 1 | 1 | 1287.925 |
| 2019-01-01 02:00:00 | 2019-01-01 | 02:00:00 | 2019 | 1 | 1 | 1231.863 |
# Summary data ####
maxv <- ceiling(max(profile$PEA_R2)) # Get a peak MW
minv <- floor(min(profile$PEA_R2)) # Get a min MW
energy <- sum(profile$PEA_R2)/2000 # Calculate the energy
peak_day <- profile %>% #Find a peak day
group_by(year) %>%
filter(PEA_R2 == max(PEA_R2)) %>%
pull(datetime)
min_day <- profile %>% #Find a peak day
group_by(year) %>%
filter(PEA_R2 == min(PEA_R2)) %>%
pull(datetime)
load_factor <- percent((energy*10^3)/(maxv*8760),
accuracy = 0.01,
decimal.mark = ".")
summary <- tibble(peak_day = peak_day,
min_day = min_day,
peak_mw = maxv,
min_mw = minv,
energy_gwh = energy,
load_factor = load_factor) # combine all data in 1 table| peak_day | min_day | peak_mw | min_mw | energy_gwh | load_factor |
|---|---|---|---|---|---|
| 2019-04-20 21:00:00 | 2019-01-01 12:00:00 | 3803 | 970 | 20007.86 | 60.06% |
# Plot a profile ####
profile_plot <-
ggplot() +
geom_line(data=profile,
aes(x = datetime,
y = PEA_R2,
group = month,
color = as.factor(month)),
show.legend = FALSE) +
ThemeLine +
labs(x = NULL,
y = "EGAT sale to PEA R2 (North Eastern region) (MW)")+
scale_x_datetime(breaks=date_breaks("1 month"),
labels=date_format("%b %y")) +
scale_y_continuous(breaks = seq(0, round(maxv,-3),1000),
limits = c(0, round(maxv, -3))) +
scale_color_manual(values = linepalette1) +
geom_point(data=summary,
aes(x = peak_day, y = peak_mw))+
geom_text(data = summary,
aes(x = peak_day, y = round(maxv, -3)),
label = glue("Peak {maxv} MW \n@ {peak_day}"))+
geom_point(data=summary,
aes(x = min_day, y = min_mw))+
geom_text(data = summary,
aes(x = min_day, y = round(minv, -3)),
label = glue("Minimum {minv} MW \n@ {min_day}"),
hjust = 0,
vjust = 1.5)
# Save the output ####
outputfigure <- paste0(outfigdir, "pea_r2_northeastern_egtsle_2019.png")
ggsave(profile_plot, file = outputfigure, dpi = 150, width = 15, height = 5, units = "in", limitsize = FALSE)
profiledata <- c(profiledata, list("pea_r2_northeastern_egtsle_2019" = profile))
profilefigure <- c(profilefigure, list("pea_r2_northeastern_egtsle_2019" = profile_plot))
summarydata <- c(summarydata, list("sum_pea_r2_northeastern_egtsle_2019" = summary))The 2019 electricity sale profile from EGAT to PEA-R2 is illustrated in Figure 2.3).
Figure 2.3: EGAT electricity sale profile to PEA-R2 in 2019.
2.2.2.3 The 2019 PEA-R3 (Southern region) EGAT sale profile
# Profile data ####
profile <-
read_excel("raw_data/raw_data_profiles/02_Hourly Sale_NetGen_2019.xlsx",
sheet = "Load Curve",
range = "C3:G17523"
) %>%
select(datetime = `Date/Time`, PEA_R3) %>%
mutate(date = date(datetime),
time = format(as.POSIXct(datetime),"%H:%M:%S"),
year = year(datetime),
month = month(datetime),
day = day(datetime)) %>%
select(datetime, date, time, year, month, day, PEA_R3) #%>%
# mutate(strdatetime = as.factor(strptime(glue("{year}-{month}-{day} {time}"), "%Y-%m-%d %H:%M:%S")))| datetime | date | time | year | month | day | PEA_R3 |
|---|---|---|---|---|---|---|
| 2019-01-01 00:00:00 | 2019-01-01 | 00:00:00 | 2019 | 1 | 1 | 1641.250 |
| 2019-01-01 00:30:00 | 2019-01-01 | 00:30:00 | 2019 | 1 | 1 | 1601.345 |
| 2019-01-01 01:00:00 | 2019-01-01 | 01:00:00 | 2019 | 1 | 1 | 1593.385 |
| 2019-01-01 01:30:00 | 2019-01-01 | 01:30:00 | 2019 | 1 | 1 | 1569.930 |
| 2019-01-01 02:00:00 | 2019-01-01 | 02:00:00 | 2019 | 1 | 1 | 1535.770 |
# Summary data ####
maxv <- ceiling(max(profile$PEA_R3)) # Get a peak MW
minv <- floor(min(profile$PEA_R3)) # Get a min MW
energy <- sum(profile$PEA_R3)/2000 # Calculate the energy
peak_day <- profile %>% #Find a peak day
group_by(year) %>%
filter(PEA_R3 == max(PEA_R3)) %>%
pull(datetime)
min_day <- profile %>% #Find a peak day
group_by(year) %>%
filter(PEA_R3 == min(PEA_R3)) %>%
pull(datetime)
load_factor <- percent((energy*10^3)/(maxv*8760),
accuracy = 0.01,
decimal.mark = ".")
summary <- tibble(peak_day = peak_day,
min_day = min_day,
peak_mw = maxv,
min_mw = minv,
energy_gwh = energy,
load_factor = load_factor) # combine all data in 1 table| peak_day | min_day | peak_mw | min_mw | energy_gwh | load_factor |
|---|---|---|---|---|---|
| 2019-04-25 19:30:00 | 2019-01-05 04:00:00 | 2609 | 1293 | 17009.67 | 74.42% |
# Plot a profile ####
profile_plot <-
ggplot() +
geom_line(data=profile,
aes(x = datetime,
y = PEA_R3,
group = month,
color = as.factor(month)),
show.legend = FALSE) +
ThemeLine +
labs(x = NULL,
y = "EGAT sale to PEA R3 (Southern region) (MW)")+
scale_x_datetime(breaks=date_breaks("1 month"),
labels=date_format("%b %y")) +
scale_y_continuous(breaks = seq(0, round(maxv,-3),1000),
limits = c(0, round(maxv, -3))) +
scale_color_manual(values = linepalette1) +
geom_point(data=summary,
aes(x = peak_day, y = peak_mw))+
geom_text(data = summary,
aes(x = peak_day, y = round(maxv, -3)),
label = glue("Peak {maxv} MW \n@ {peak_day}"))+
geom_point(data=summary,
aes(x = min_day, y = min_mw))+
geom_text(data = summary,
aes(x = min_day, y = round(minv, -3)),
label = glue("Minimum {minv} MW \n@ {min_day}"),
hjust = 0,
vjust = 1.5)
# Save the output ####
outputfigure <- paste0(outfigdir, "pea_r3_southern_egtsle_2019.png")
ggsave(profile_plot, file = outputfigure, dpi = 150, width = 15, height = 5, units = "in", limitsize = FALSE)
profiledata <- c(profiledata, list("pea_r3_southern_egtsle_2019" = profile))
profilefigure <- c(profilefigure, list("pea_r3_southern_egtsle_2019" = profile_plot))
summarydata <- c(summarydata, list("sum_pea_r3_southern_egtsle_2019" = summary))The 2019 electricity sale profile from EGAT to PEA-R3 is illustrated in Figure 2.4).
Figure 2.4: EGAT electricity sale profile to PEA-R3 in 2019.
2.2.2.4 The 2019 PEA-R4 (Northern region) EGAT sale profile
# Profile data ####
profile <-
read_excel("raw_data/raw_data_profiles/02_Hourly Sale_NetGen_2019.xlsx",
sheet = "Load Curve",
range = "C3:H17523"
) %>%
select(datetime = `Date/Time`, PEA_R4) %>%
mutate(date = date(datetime),
time = format(as.POSIXct(datetime),"%H:%M:%S"),
year = year(datetime),
month = month(datetime),
day = day(datetime)) %>%
select(datetime, date, time, year, month, day, PEA_R4) #%>% | datetime | date | time | year | month | day | PEA_R4 |
|---|---|---|---|---|---|---|
| 2019-01-01 00:00:00 | 2019-01-01 | 00:00:00 | 2019 | 1 | 1 | 1287.513 |
| 2019-01-01 00:30:00 | 2019-01-01 | 00:30:00 | 2019 | 1 | 1 | 1231.703 |
| 2019-01-01 01:00:00 | 2019-01-01 | 01:00:00 | 2019 | 1 | 1 | 1195.394 |
| 2019-01-01 01:30:00 | 2019-01-01 | 01:30:00 | 2019 | 1 | 1 | 1139.654 |
| 2019-01-01 02:00:00 | 2019-01-01 | 02:00:00 | 2019 | 1 | 1 | 1082.499 |
| peak_day | min_day | peak_mw | min_mw | energy_gwh | load_factor |
|---|---|---|---|---|---|
| 2019-05-20 21:30:00 | 2019-12-09 03:30:00 | 3224 | 941 | 16572.57 | 58.68% |
# Plot a profile ####
profile_plot <-
ggplot() +
geom_line(data=profile,
aes(x = datetime,
y = PEA_R4,
group = month,
color = as.factor(month)),
show.legend = FALSE) +
ThemeLine +
labs(x = NULL,
y = "EGAT sale to PEA R4 (Northern region) (MW)")+
scale_x_datetime(breaks=date_breaks("1 month"),
labels=date_format("%b %y")) +
scale_y_continuous(breaks = seq(0, round(maxv,-3)*1.2,1000),
limits = c(0, round(maxv, -3)*1.2)) +
scale_color_manual(values = linepalette1) +
geom_point(data=summary,
aes(x = peak_day, y = peak_mw))+
geom_text(data = summary,
aes(x = peak_day, y = round(maxv, -3)*1.2),
label = glue("Peak {maxv} MW \n@ {peak_day}"))+
geom_point(data=summary,
aes(x = min_day, y = min_mw))+
geom_text(data = summary,
aes(x = min_day, y = round(minv, -3)),
label = glue("Minimum {minv} MW \n@ {min_day}"),
hjust = 0.5,
vjust = 1.5)
# Save the output ####
outputfigure <- paste0(outfigdir, "pea_r4_northern_egtsle_2019.png")
ggsave(profile_plot, file = outputfigure, dpi = 150, width = 15, height = 5, units = "in", limitsize = FALSE)
profiledata <- c(profiledata, list("pea_r4_northern_egtsle_2019" = profile))
profilefigure <- c(profilefigure, list("pea_r4_northern_egtsle_2019" = profile_plot))
summarydata <- c(summarydata, list("sum_pea_r4_northern_egtsle_2019" = summary))The 2019 electricity sale profile from EGAT to PEA-R4 is illustrated in Figure 2.5).
Figure 2.5: EGAT electricity sale profile to PEA-R4 in 2019.
2.2.2.5 The 2019 PEA (All regions) EGAT sale profile
# Profile data ####
profile <-
read_excel("raw_data/raw_data_profiles/02_Hourly Sale_NetGen_2019.xlsx",
sheet = "Load Curve",
range = "C3:I17523"
) %>%
select(datetime = `Date/Time`, PEA) %>%
mutate(date = date(datetime),
time = format(as.POSIXct(datetime),"%H:%M:%S"),
year = year(datetime),
month = month(datetime),
day = day(datetime)) %>%
select(datetime, date, time, year, month, day, PEA) | datetime | date | time | year | month | day | PEA |
|---|---|---|---|---|---|---|
| 2019-01-01 00:00:00 | 2019-01-01 | 00:00:00 | 2019 | 1 | 1 | 9425.265 |
| 2019-01-01 00:30:00 | 2019-01-01 | 00:30:00 | 2019 | 1 | 1 | 9156.250 |
| 2019-01-01 01:00:00 | 2019-01-01 | 01:00:00 | 2019 | 1 | 1 | 9068.097 |
| 2019-01-01 01:30:00 | 2019-01-01 | 01:30:00 | 2019 | 1 | 1 | 8790.850 |
| 2019-01-01 02:00:00 | 2019-01-01 | 02:00:00 | 2019 | 1 | 1 | 8639.943 |
| peak_day | min_day | peak_mw | min_mw | energy_gwh | load_factor |
|---|---|---|---|---|---|
| 2019-04-20 21:00:00 | 2019-01-01 12:00:00 | 21151 | 6877 | 134551.5 | 72.62% |
# Plot a profile ####
profile_plot <-
ggplot() +
geom_line(data=profile,
aes(x = datetime,
y = PEA,
group = month,
color = as.factor(month)),
show.legend = FALSE) +
ThemeLine +
labs(x = NULL,
y = "EGAT sale to PEA (All regions) (MW)")+
scale_x_datetime(breaks=date_breaks("1 month"),
labels=date_format("%b %y")) +
scale_y_continuous(breaks = seq(0, round(maxv,-3)*1.1,1000),
limits = c(0, round(maxv, -3)*1.1)) +
scale_color_manual(values = linepalette1) +
geom_point(data=summary,
aes(x = peak_day, y = peak_mw))+
geom_text(data = summary,
aes(x = peak_day, y = round(maxv, -3)*1.1),
label = glue("Peak {maxv} MW \n@ {peak_day}"))+
geom_point(data=summary,
aes(x = min_day, y = min_mw))+
geom_text(data = summary,
aes(x = min_day, y = round(minv, -3)),
label = glue("Minimum {minv} MW \n@ {min_day}"),
hjust = -0.1,
vjust = 1.5)
# Save the output ####
outputfigure <- paste0(outfigdir, "pea_allregion_egtsle_2019.png")
ggsave(profile_plot, file = outputfigure, dpi = 150, width = 15, height = 5, units = "in", limitsize = FALSE)
profiledata <- c(profiledata, list("pea_allregion_egtsle_2019" = profile))
profilefigure <- c(profilefigure, list("pea_allregion_egtsle_2019" = profile_plot))
summarydata <- c(summarydata, list("sum_pea_allregion_egtsle_2019" = summary))The 2019 electricity sale profile from EGAT to PEA (all regions) is illustrated in Figure 2.6).
Figure 2.6: EGAT electricity sale profile to PEA (all regions) in 2019.
2.2.3 The 2019 Direct Customer (DC) EGAT sale profiles
2.2.3.1 The 2019 DC in in PEA R1 (Central region) EGAT sale profiles
# Profile data ####
profile <-
read_excel("raw_data/raw_data_profiles/02_Hourly Sale_NetGen_2019.xlsx",
sheet = "Load Curve",
range = "C3:J17523"
) %>%
select(datetime = `Date/Time`, DCs_R1) %>%
mutate(date = date(datetime),
time = format(as.POSIXct(datetime),"%H:%M:%S"),
year = year(datetime),
month = month(datetime),
day = day(datetime)) %>%
select(datetime, date, time, year, month, day, DCs_R1) #%>% | datetime | date | time | year | month | day | DCs_R1 |
|---|---|---|---|---|---|---|
| 2019-01-01 00:00:00 | 2019-01-01 | 00:00:00 | 2019 | 1 | 1 | 201.253 |
| 2019-01-01 00:30:00 | 2019-01-01 | 00:30:00 | 2019 | 1 | 1 | 202.469 |
| 2019-01-01 01:00:00 | 2019-01-01 | 01:00:00 | 2019 | 1 | 1 | 190.028 |
| 2019-01-01 01:30:00 | 2019-01-01 | 01:30:00 | 2019 | 1 | 1 | 196.300 |
| 2019-01-01 02:00:00 | 2019-01-01 | 02:00:00 | 2019 | 1 | 1 | 177.956 |
# Summary data ####
maxv <- ceiling(max(profile$DCs_R1)) # Get a peak MW
minv <- floor(min(profile$DCs_R1)) # Get a min MW
energy <- sum(profile$DCs_R1)/2000 # Calculate the energy
peak_day <- profile %>% #Find a peak day
group_by(year) %>%
filter(DCs_R1 == max(DCs_R1)) %>%
pull(datetime)
min_day <- profile %>% #Find a peak day
group_by(year) %>%
filter(DCs_R1 == min(DCs_R1)) %>%
pull(datetime)
load_factor <- percent((energy*10^3)/(maxv*8760),
accuracy = 0.01,
decimal.mark = ".")
summary <- tibble(peak_day = peak_day,
min_day = min_day,
peak_mw = maxv,
min_mw = minv,
energy_gwh = energy,
load_factor = load_factor) # combine all data in 1 tableknitr::kable(
summary, caption = 'Summary of EGAT sale to direct customer in PEA-R1 in 2019',
booktabs = TRUE
)| peak_day | min_day | peak_mw | min_mw | energy_gwh | load_factor |
|---|---|---|---|---|---|
| 2019-03-23 05:30:00 | 2019-09-11 13:00:00 | 421 | 81 | 2006.585 | 54.41% |
# Plot a profile ####
profile_plot <-
ggplot() +
geom_line(data=profile,
aes(x = datetime,
y = DCs_R1,
group = month,
color = as.factor(month)),
show.legend = FALSE) +
ThemeLine +
labs(x = NULL,
y = "EGAT sale to direct customers in PEA R1 (Central region) (MW)")+
scale_x_datetime(breaks=date_breaks("1 month"),
labels=date_format("%b %y")) +
scale_y_continuous(breaks = seq(0, round(maxv,-2)*1.2,100),
limits = c(0, round(maxv, -2)*1.2)) +
scale_color_manual(values = linepalette1) +
geom_point(data=summary,
aes(x = peak_day, y = peak_mw))+
geom_text(data = summary,
aes(x = peak_day, y = round(maxv, -2)*1.2),
label = glue("Peak {maxv} MW \n@ {peak_day}"))+
geom_point(data=summary,
aes(x = min_day, y = min_mw))+
geom_text(data = summary,
aes(x = min_day, y = round(minv, -2)),
label = glue("Minimum {minv} MW \n@ {min_day}"),
hjust = 0,
vjust = 1.5)
# Save the output ####
outputfigure <- paste0(outfigdir, "dc_r1_central_egtsle_2019.png")
ggsave(profile_plot, file = outputfigure, dpi = 150, width = 15, height = 5, units = "in", limitsize = FALSE)
profiledata <- c(profiledata, list("dc_r1_central_egtsle_2019" = profile))
profilefigure <- c(profilefigure, list("dc_r1_central_egtsle_2019" = profile_plot))
summarydata <- c(summarydata, list("sum_dc_r1_central_egtsle_2019" = summary))The 2019 electricity sale profile from EGAT to direct customer in PEA-R1 is illustrated in Figure 2.7).
Figure 2.7: EGAT electricity sale profile to direct customer in PEA-R1 in 2019.
2.2.3.2 The 2019 DC in in PEA R2 (North Eastern region) EGAT sale profiles
# Profile data ####
profile <-
read_excel("raw_data/raw_data_profiles/02_Hourly Sale_NetGen_2019.xlsx",
sheet = "Load Curve",
range = "C3:K17523"
) %>%
select(datetime = `Date/Time`, DCs_R2) %>%
mutate(date = date(datetime),
time = format(as.POSIXct(datetime),"%H:%M:%S"),
year = year(datetime),
month = month(datetime),
day = day(datetime)) %>%
select(datetime, date, time, year, month, day, DCs_R2) #%>% | datetime | date | time | year | month | day | DCs_R2 |
|---|---|---|---|---|---|---|
| 2019-01-01 00:00:00 | 2019-01-01 | 00:00:00 | 2019 | 1 | 1 | 45.91 |
| 2019-01-01 00:30:00 | 2019-01-01 | 00:30:00 | 2019 | 1 | 1 | 74.97 |
| 2019-01-01 01:00:00 | 2019-01-01 | 01:00:00 | 2019 | 1 | 1 | 72.34 |
| 2019-01-01 01:30:00 | 2019-01-01 | 01:30:00 | 2019 | 1 | 1 | 70.17 |
| 2019-01-01 02:00:00 | 2019-01-01 | 02:00:00 | 2019 | 1 | 1 | 68.94 |
# Summary data ####
maxv <- ceiling(max(profile$DCs_R2)) # Get a peak MW
minv <- floor(min(profile$DCs_R2)) # Get a min MW
energy <- sum(profile$DCs_R2)/2000 # Calculate the energy
peak_day <- profile %>% #Find a peak day
group_by(year) %>%
filter(DCs_R2 == max(DCs_R2)) %>%
pull(datetime)
min_day <- profile %>% #Find a min day
group_by(year) %>%
filter(DCs_R2 == min(DCs_R2)) %>%
last() %>%
pull(datetime)
load_factor <- percent((energy*10^3)/(maxv*8760),
accuracy = 0.01,
decimal.mark = ".")
summary <- tibble(peak_day = peak_day,
min_day = min_day,
peak_mw = maxv,
min_mw = minv,
energy_gwh = energy,
load_factor = load_factor) # combine all data in 1 table| peak_day | min_day | peak_mw | min_mw | energy_gwh | load_factor |
|---|---|---|---|---|---|
| 2019-05-20 22:30:00 | 2019-09-17 07:30:00 | 609 | 0 | 1300.891 | 24.38% |
# Plot a profile ####
profile_plot <-
ggplot() +
geom_line(data=profile,
aes(x = datetime,
y = DCs_R2,
group = month,
color = as.factor(month)),
show.legend = FALSE) +
ThemeLine +
labs(x = NULL,
y = "EGAT sale to direct customers in PEA R2 (North Eastern region) (MW)")+
scale_x_datetime(breaks=date_breaks("1 month"),
labels=date_format("%b %y")) +
scale_y_continuous(breaks = seq(0, round(maxv,-2)*1.2,100),
limits = c(0, round(maxv, -2)*1.2)) +
scale_color_manual(values = linepalette1) +
geom_point(data=summary,
aes(x = peak_day, y = peak_mw))+
geom_text(data = summary,
aes(x = peak_day, y = round(maxv, -2)*1.1),
label = glue("Peak {maxv} MW \n@ {peak_day}"))+
geom_point(data=summary,
aes(x = min_day, y = min_mw))+
geom_text(data = summary,
aes(x = min_day, y = round(minv, -2)),
label = glue("Minimum {minv} MW \n@ {min_day}"),
hjust = 0,
vjust = 0)
# Save the output ####
outputfigure <- paste0(outfigdir, "dc_r2_northeastern_egtsle_2019.png")
ggsave(profile_plot, file = outputfigure, dpi = 150, width = 15, height = 5, units = "in", limitsize = FALSE)
profiledata <- c(profiledata, list("dc_r2_northeastern_egtsle_2019" = profile))
profilefigure <- c(profilefigure, list("dc_r2_northeastern_egtsle_2019" = profile_plot))
summarydata <- c(summarydata, list("sum_dc_r2_northeastern_egtsle_2019" = summary))The 2019 electricity sale profile from EGAT to direct customer in PEA-R2 is illustrated in Figure 2.8).
Figure 2.8: EGAT electricity sale profile to direct customer in PEA-R2 in 2019.
2.2.3.3 The 2019 DC in in PEA R3 (Southern region) EGAT sale profiles
# Profile data ####
profile <-
read_excel("raw_data/raw_data_profiles/02_Hourly Sale_NetGen_2019.xlsx",
sheet = "Load Curve",
range = "C3:L17523"
) %>%
select(datetime = `Date/Time`, DCs_R3) %>%
mutate(date = date(datetime),
time = format(as.POSIXct(datetime),"%H:%M:%S"),
year = year(datetime),
month = month(datetime),
day = day(datetime)) %>%
select(datetime, date, time, year, month, day, DCs_R3) #%>% | datetime | date | time | year | month | day | DCs_R3 |
|---|---|---|---|---|---|---|
| 2019-01-01 00:00:00 | 2019-01-01 | 00:00:00 | 2019 | 1 | 1 | 17.170 |
| 2019-01-01 00:30:00 | 2019-01-01 | 00:30:00 | 2019 | 1 | 1 | 16.990 |
| 2019-01-01 01:00:00 | 2019-01-01 | 01:00:00 | 2019 | 1 | 1 | 16.455 |
| 2019-01-01 01:30:00 | 2019-01-01 | 01:30:00 | 2019 | 1 | 1 | 17.045 |
| 2019-01-01 02:00:00 | 2019-01-01 | 02:00:00 | 2019 | 1 | 1 | 16.760 |
# Summary data ####
maxv <- ceiling(max(profile$DCs_R3)) # Get a peak MW
minv <- floor(min(profile$DCs_R3)) # Get a min MW
energy <- sum(profile$DCs_R3)/2000 # Calculate the energy
peak_day <- profile %>% #Find a peak day
group_by(year) %>%
filter(DCs_R3 == max(DCs_R3)) %>%
pull(datetime)
min_day <- profile %>% #Find a min day
group_by(year) %>%
filter(DCs_R3 == min(DCs_R3)) %>%
last() %>%
pull(datetime)
load_factor <- percent((energy*10^3)/(maxv*8760),
accuracy = 0.01,
decimal.mark = ".")
summary <- tibble(peak_day = peak_day,
min_day = min_day,
peak_mw = maxv,
min_mw = minv,
energy_gwh = energy,
load_factor = load_factor) # combine all data in 1 table| peak_day | min_day | peak_mw | min_mw | energy_gwh | load_factor |
|---|---|---|---|---|---|
| 2019-12-14 15:00:00 | 2019-03-30 14:30:00 | 253 | 0 | 419.8491 | 18.94% |
# Plot a profile ####
profile_plot <-
ggplot() +
geom_line(data=profile,
aes(x = datetime,
y = DCs_R3,
group = month,
color = as.factor(month)),
show.legend = FALSE) +
ThemeLine +
labs(x = NULL,
y = "EGAT sale to direct customers in PEA R3 (Southern region) (MW)")+
scale_x_datetime(breaks=date_breaks("1 month"),
labels=date_format("%b %y")) +
scale_y_continuous(breaks = seq(0, round(maxv,-2),100),
limits = c(0, round(maxv, -2))) +
scale_color_manual(values = linepalette1) +
geom_point(data=summary,
aes(x = peak_day, y = peak_mw))+
geom_text(data = summary,
aes(x = peak_day, y = round(maxv, -2)),
label = glue("Peak {maxv} MW \n@ {peak_day}"))+
geom_point(data=summary,
aes(x = min_day, y = min_mw))+
geom_text(data = summary,
aes(x = min_day, y = round(minv, -2)),
label = glue("Minimum {minv} MW \n@ {min_day}"),
hjust = 0,
vjust = 0)
# Save the output ####
outputfigure <- paste0(outfigdir, "dc_r3_southern_egtsle_2019.png")
ggsave(profile_plot, file = outputfigure, dpi = 150, width = 15, height = 5, units = "in", limitsize = FALSE)
profiledata <- c(profiledata, list("dc_r3_southern_egtsle_2019" = profile))
profilefigure <- c(profilefigure, list("dc_r3_southern_egtsle_2019" = profile_plot))
summarydata <- c(summarydata, list("sum_dc_r3_southern_egtsle_2019" = summary))The 2019 electricity sale profile from EGAT to direct customer in PEA-R3 is illustrated in Figure 2.9).
Figure 2.9: EGAT electricity sale profile to direct customer in PEA-R3 in 2019.
2.2.3.4 The 2019 DC in in PEA R4 (Northern region) EGAT sale profiles
# Profile data ####
profile <-
read_excel("raw_data/raw_data_profiles/02_Hourly Sale_NetGen_2019.xlsx",
sheet = "Load Curve",
range = "C3:M17523"
) %>%
select(datetime = `Date/Time`, DCs_R4) %>%
mutate(date = date(datetime),
time = format(as.POSIXct(datetime),"%H:%M:%S"),
year = year(datetime),
month = month(datetime),
day = day(datetime)) %>%
select(datetime, date, time, year, month, day, DCs_R4) #%>% | datetime | date | time | year | month | day | DCs_R4 |
|---|---|---|---|---|---|---|
| 2019-01-01 00:00:00 | 2019-01-01 | 00:00:00 | 2019 | 1 | 1 | 18.341 |
| 2019-01-01 00:30:00 | 2019-01-01 | 00:30:00 | 2019 | 1 | 1 | 20.824 |
| 2019-01-01 01:00:00 | 2019-01-01 | 01:00:00 | 2019 | 1 | 1 | 20.921 |
| 2019-01-01 01:30:00 | 2019-01-01 | 01:30:00 | 2019 | 1 | 1 | 28.174 |
| 2019-01-01 02:00:00 | 2019-01-01 | 02:00:00 | 2019 | 1 | 1 | 24.071 |
# Summary data ####
maxv <- ceiling(max(profile$DCs_R4)) # Get a peak MW
minv <- floor(min(profile$DCs_R4)) # Get a min MW
energy <- sum(profile$DCs_R4)/2000 # Calculate the energy
peak_day <- profile %>% #Find a peak day
group_by(year) %>%
filter(DCs_R4 == max(DCs_R4)) %>%
pull(datetime)
min_day <- profile %>% #Find a min day
group_by(year) %>%
filter(DCs_R4 == min(DCs_R4)) %>%
last() %>%
pull(datetime)
load_factor <- percent((energy*10^3)/(maxv*8760),
accuracy = 0.01,
decimal.mark = ".")
summary <- tibble(peak_day = peak_day,
min_day = min_day,
peak_mw = maxv,
min_mw = minv,
energy_gwh = energy,
load_factor = load_factor) # combine all data in 1 table| peak_day | min_day | peak_mw | min_mw | energy_gwh | load_factor |
|---|---|---|---|---|---|
| 2019-02-02 16:00:00 | 2019-12-31 10:30:00 | 67 | 0 | 250.4462 | 42.67% |
# Plot a profile ####
profile_plot <-
ggplot() +
geom_line(data=profile,
aes(x = datetime,
y = DCs_R4,
group = month,
color = as.factor(month)),
show.legend = FALSE) +
ThemeLine +
labs(x = NULL,
y = "EGAT sale to direct customers in PEA R4 (Northern region) (MW)")+
scale_x_datetime(breaks=date_breaks("1 month"),
labels=date_format("%b %y")) +
scale_y_continuous(breaks = seq(0, round(maxv,-1),10),
limits = c(0, round(maxv, -1))) +
scale_color_manual(values = linepalette1) +
geom_point(data=summary,
aes(x = peak_day, y = peak_mw))+
geom_text(data = summary,
aes(x = peak_day, y = round(maxv, -1)),
label = glue("Peak {maxv} MW \n@ {peak_day}"),
hjust = 0.5) +
geom_point(data=summary,
aes(x = min_day, y = min_mw))+
geom_text(data = summary,
aes(x = min_day, y = round(minv, -1)),
label = glue("Minimum {minv} MW \n@ {min_day}"),
hjust = 1,
vjust = -0.5)
# Save the output ####
outputfigure <- paste0(outfigdir, "dc_r4_northern_egtsle_2019.png")
ggsave(profile_plot, file = outputfigure, dpi = 150, width = 15, height = 5, units = "in", limitsize = FALSE)
profiledata <- c(profiledata, list("dc_r4_northern_egtsle_2019" = profile))
profilefigure <- c(profilefigure, list("dc_r4_northern_egtsle_2019" = profile_plot))
summarydata <- c(summarydata, list("dc_r4_northern_egtsle_2019" = summary))The 2019 electricity sale profile from EGAT to direct customer in PEA-R4 is illustrated in Figure 2.10).
Figure 2.10: EGAT electricity sale profile to direct customer in PEA-R4 in 2019.
2.2.3.5 The 2019 DC in in PEA (All regions) EGAT sale profiles
# Profile data ####
profile <-
read_excel("raw_data/raw_data_profiles/02_Hourly Sale_NetGen_2019.xlsx",
sheet = "Load Curve",
range = "C3:N17523"
) %>%
select(datetime = `Date/Time`, DCs) %>%
mutate(date = date(datetime),
time = format(as.POSIXct(datetime),"%H:%M:%S"),
year = year(datetime),
month = month(datetime),
day = day(datetime)) %>%
select(datetime, date, time, year, month, day, DCs) #%>% | datetime | date | time | year | month | day | DCs |
|---|---|---|---|---|---|---|
| 2019-01-01 00:00:00 | 2019-01-01 | 00:00:00 | 2019 | 1 | 1 | 282.674 |
| 2019-01-01 00:30:00 | 2019-01-01 | 00:30:00 | 2019 | 1 | 1 | 315.253 |
| 2019-01-01 01:00:00 | 2019-01-01 | 01:00:00 | 2019 | 1 | 1 | 299.744 |
| 2019-01-01 01:30:00 | 2019-01-01 | 01:30:00 | 2019 | 1 | 1 | 311.689 |
| 2019-01-01 02:00:00 | 2019-01-01 | 02:00:00 | 2019 | 1 | 1 | 287.727 |
# Summary data ####
maxv <- ceiling(max(profile$DCs)) # Get a peak MW
minv <- floor(min(profile$DCs)) # Get a min MW
energy <- sum(profile$DCs)/2000 # Calculate the energy
peak_day <- profile %>% #Find a peak day
group_by(year) %>%
filter(DCs == max(DCs)) %>%
pull(datetime)
min_day <- profile %>% #Find a min day
group_by(year) %>%
filter(DCs == min(DCs)) %>%
last() %>%
pull(datetime)
load_factor <- percent((energy*10^3)/(maxv*8760),
accuracy = 0.01,
decimal.mark = ".")
summary <- tibble(peak_day = peak_day,
min_day = min_day,
peak_mw = maxv,
min_mw = minv,
energy_gwh = energy,
load_factor = load_factor) # combine all data in 1 table| peak_day | min_day | peak_mw | min_mw | energy_gwh | load_factor |
|---|---|---|---|---|---|
| 2019-12-14 10:00:00 | 2019-07-10 16:30:00 | 1043 | 111 | 3977.771 | 43.54% |
# Plot a profile ####
profile_plot <-
ggplot() +
geom_line(data=profile,
aes(x = datetime,
y = DCs,
group = month,
color = as.factor(month)),
show.legend = FALSE) +
ThemeLine +
labs(x = NULL,
y = "EGAT sale to direct customers in PEA (All regions) (MW)")+
scale_x_datetime(breaks=date_breaks("1 month"),
labels=date_format("%b %y")) +
scale_y_continuous(breaks = seq(0, round(maxv,-2)*1.2,100),
limits = c(0, round(maxv, -2)*1.2)) +
scale_color_manual(values = linepalette1) +
geom_point(data=summary,
aes(x = peak_day, y = peak_mw))+
geom_text(data = summary,
aes(x = peak_day, y = round(maxv, -2)*1.2),
label = glue("Peak {maxv} MW \n@ {peak_day}"),
hjust = 0.5,
vjust = 1.5) +
geom_point(data=summary,
aes(x = min_day, y = min_mw))+
geom_text(data = summary,
aes(x = min_day, y = round(minv, -2)),
label = glue("Minimum {minv} MW \n@ {min_day}"),
# hjust = 0,
vjust = 1)
# Save the output ####
outputfigure <- paste0(outfigdir, "dc_allregions_egtsle_2019.png")
ggsave(profile_plot, file = outputfigure, dpi = 150, width = 15, height = 5, units = "in", limitsize = FALSE)
profiledata <- c(profiledata, list("dc_allregions_egtsle_2019" = profile))
profilefigure <- c(profilefigure, list("dc_allregions_egtsle_2019" = profile_plot))
summarydata <- c(summarydata, list("sum_dc_allregions_egtsle_2019" = summary))The 2019 electricity sale profile from EGAT to direct customer in PEA (all regions) is illustrated in Figure 2.11).
Figure 2.11: EGAT electricity sale profile to direct customer in PEA (all regions) in 2019.
2.2.4 The 2019 PEA R1 & DC R1 (Central region) EGAT electrity sale profiles
The electricity profile in PEA region is combined the electricity profile in PEA regions (see section 2.2.2) and DC in PEA regions (see section 2.2.3)
\[\begin{equation} Prf_{r,t,h}=\ Prf_{PEA,t,h} + Prf_{DC,t,h} \tag{2.3} \end{equation}\]
Where, \(Prf_{r,t,h}\) denotes an calculated profile in region \(r\), year \(t\), and time \(h\) (MW).
\(Prf_{PEA,t,h}\) denotes a profile in \(PEA\) from each region in year \(t\) at time \(h\) (MW).
\(Prf_{DC,t,h}\) denotes a profile from direct customer (\(DC\)) in each PEA region in year \(t\) at time \(h\) (MW).
# Profile data ####
profile <-
profiledata$pea_r1_central_egtsle_2019%>%
mutate(dc_r1 = profiledata$dc_r1_central_egtsle_2019$DCs_R1,
r1_egt_sle = PEA_R1 + dc_r1) %>%
select(-PEA_R1, -dc_r1)| datetime | date | time | year | month | day | r1_egt_sle |
|---|---|---|---|---|---|---|
| 2019-01-01 00:00:00 | 2019-01-01 | 00:00:00 | 2019 | 1 | 1 | 5238.235 |
| 2019-01-01 00:30:00 | 2019-01-01 | 00:30:00 | 2019 | 1 | 1 | 5109.824 |
| 2019-01-01 01:00:00 | 2019-01-01 | 01:00:00 | 2019 | 1 | 1 | 5119.154 |
| 2019-01-01 01:30:00 | 2019-01-01 | 01:30:00 | 2019 | 1 | 1 | 4989.641 |
| 2019-01-01 02:00:00 | 2019-01-01 | 02:00:00 | 2019 | 1 | 1 | 4967.767 |
# Summary data ####
maxv <- ceiling(max(profile$r1_egt_sle)) # Get a peak MW
minv <- floor(min(profile$r1_egt_sle)) # Get a min MW
energy <- sum(profile$r1_egt_sle)/2000 # Calculate the energy
peak_day <- profile %>% #Find a peak day
group_by(year) %>%
filter(r1_egt_sle == max(r1_egt_sle)) %>%
pull(datetime)
min_day <- profile %>% #Find a min day
group_by(year) %>%
filter(r1_egt_sle == min(r1_egt_sle)) %>%
last() %>%
pull(datetime)
load_factor <- percent((energy*10^3)/(maxv*8760),
accuracy = 0.01,
decimal.mark = ".")
summary <- tibble(peak_day = peak_day,
min_day = min_day,
peak_mw = maxv,
min_mw = minv,
energy_gwh = energy,
load_factor = load_factor) # combine all data in 1 table| peak_day | min_day | peak_mw | min_mw | energy_gwh | load_factor |
|---|---|---|---|---|---|
| 2019-05-03 23:00:00 | 2019-01-01 12:00:00 | 12245 | 3492 | 82967.95 | 77.35% |
# Plot a profile ####
profile_plot <-
ggplot() +
geom_line(data=profile,
aes(x = datetime,
y = r1_egt_sle,
group = month,
color = as.factor(month)),
show.legend = FALSE) +
ThemeLine +
labs(x = NULL,
y = "EGAT sale to PEA R1 & direct customers (Central region) (MW)")+
scale_x_datetime(breaks=date_breaks("1 month"),
labels=date_format("%b %y")) +
scale_y_continuous(breaks = seq(0, round(maxv,-3)*1.1,1000),
limits = c(0, round(maxv, -3)*1.1)) +
scale_color_manual(values = linepalette1) +
geom_point(data=summary,
aes(x = peak_day, y = peak_mw))+
geom_text(data = summary,
aes(x = peak_day, y = round(maxv, -3)*1.1),
label = glue("Peak {maxv} MW \n@ {peak_day}"),
hjust = 0.5) +
geom_point(data=summary,
aes(x = min_day, y = min_mw))+
geom_text(data = summary,
aes(x = min_day, y = round(minv, -3)*1.1),
label = glue("Minimum {minv} MW \n@ {min_day}"),
hjust = -0.05,
vjust = 0.5)
# Save the output ####
outputfigure <- paste0(outfigdir, "r1+dcr1_egtsle_2019.png")
ggsave(profile_plot, file = outputfigure, dpi = 150, width = 15, height = 5, units = "in", limitsize = FALSE)
profiledata <- c(profiledata, list("r1+dcr1_egtsle_2019" = profile))
profilefigure <- c(profilefigure, list("r1+dcr1_egtsle_2019" = profile_plot))
summarydata <- c(summarydata, list("sum_r1+dcr1_egtsle_2019" = summary))The 2019 electricity sale profile from EGAT to PEA R1 and direct customer in PEA R1 is illustrated in Figure 2.12. The electricity EGAT sale profiles of PEA R1 and direct customer in PEA R1 are illustrated in Figure 2.2 and 2.7, respectively.
Figure 2.12: EGAT electricity sale profile to PEA R1 and direct customer in PEA R1 in 2019.
2.2.5 The 2019 PEA R2 & DC R2 (North Eastern region) EGAT electrity sale profiles
# Profile data ####
profile <-
profiledata$pea_r2_northeastern_egtsle_2019%>%
mutate(dc_r2 = profiledata$dc_r2_northeastern_egtsle_2019$DCs_R2,
r2_egt_sle = PEA_R2 + dc_r2) %>%
select(-PEA_R2, -dc_r2)| datetime | date | time | year | month | day | r2_egt_sle |
|---|---|---|---|---|---|---|
| 2019-01-01 00:00:00 | 2019-01-01 | 00:00:00 | 2019 | 1 | 1 | 1505.430 |
| 2019-01-01 00:30:00 | 2019-01-01 | 00:30:00 | 2019 | 1 | 1 | 1490.816 |
| 2019-01-01 01:00:00 | 2019-01-01 | 01:00:00 | 2019 | 1 | 1 | 1422.532 |
| 2019-01-01 01:30:00 | 2019-01-01 | 01:30:00 | 2019 | 1 | 1 | 1358.095 |
| 2019-01-01 02:00:00 | 2019-01-01 | 02:00:00 | 2019 | 1 | 1 | 1300.803 |
# Summary data ####
maxv <- ceiling(max(profile$r2_egt_sle)) # Get a peak MW
minv <- floor(min(profile$r2_egt_sle)) # Get a min MW
energy <- sum(profile$r2_egt_sle)/2000 # Calculate the energy
peak_day <- profile %>% #Find a peak day
group_by(year) %>%
filter(r2_egt_sle == max(r2_egt_sle)) %>%
pull(datetime)
min_day <- profile %>% #Find a min day
group_by(year) %>%
filter(r2_egt_sle == min(r2_egt_sle)) %>%
last() %>%
pull(datetime)
load_factor <- percent((energy*10^3)/(maxv*8760),
accuracy = 0.01,
decimal.mark = ".")
summary <- tibble(peak_day = peak_day,
min_day = min_day,
peak_mw = maxv,
min_mw = minv,
energy_gwh = energy,
load_factor = load_factor) # combine all data in 1 table| peak_day | min_day | peak_mw | min_mw | energy_gwh | load_factor |
|---|---|---|---|---|---|
| 2019-04-20 22:00:00 | 2019-01-01 13:00:00 | 4043 | 990 | 21308.75 | 60.17% |
profile_plot <-
ggplot() +
geom_line(data=profile,
aes(x = datetime,
y = r2_egt_sle,
group = month,
color = as.factor(month)),
show.legend = FALSE) +
ThemeLine +
labs(x = NULL,
y = "EGAT sale to PEA R2 & direct customers (Northern Eastern region) (MW)")+
scale_x_datetime(breaks=date_breaks("1 month"),
labels=date_format("%b %y")) +
scale_y_continuous(breaks = seq(0, round(maxv,-3)*1.1,1000),
limits = c(0, round(maxv, -3)*1.1)) +
scale_color_manual(values = linepalette1) +
geom_point(data=summary,
aes(x = peak_day, y = peak_mw))+
geom_text(data = summary,
aes(x = peak_day, y = round(maxv, -3)*1.1),
label = glue("Peak {maxv} MW \n@ {peak_day}"),
hjust = 0.5) +
geom_point(data=summary,
aes(x = min_day, y = min_mw))+
geom_text(data = summary,
aes(x = min_day, y = round(minv, -3)*1.1),
label = glue("Minimum {minv} MW \n@ {min_day}"),
hjust = -0.05,
vjust = 0.5)
# Save the output ####
outputfigure <- paste0(outfigdir, "r2+dcr2_egtsle_2019.png")
ggsave(profile_plot, file = outputfigure, dpi = 150, width = 15, height = 5, units = "in", limitsize = FALSE)
profiledata <- c(profiledata, list("r2+dcr2_egtsle_2019" = profile))
profilefigure <- c(profilefigure, list("r2+dcr2_egtsle_2019" = profile_plot))
summarydata <- c(summarydata, list("sum_r2+dcr2_egtsle_2019" = summary))The 2019 electricity sale profile from EGAT to PEA R2 and direct customer in PEA R2 is illustrated in Figure 2.13. The electricity EGAT sale profiles of PEA R2 and direct customer in PEA R2 are illustrated in Figure 2.3 and 2.8, respectively.
Figure 2.13: EGAT electricity sale profile to PEA R2 and direct customer in PEA R2 in 2019.
2.2.6 The 2019 PEA R3 & DC R3 (Southern region) EGAT electrity sale profiles
profile <-
profiledata$pea_r3_southern_egtsle_2019%>%
mutate(dc_r3 = profiledata$dc_r3_southern_egtsle_2019$DCs_R3,
r3_egt_sle = PEA_R3 + dc_r3) %>%
select(-PEA_R3, -dc_r3)| datetime | date | time | year | month | day | r3_egt_sle |
|---|---|---|---|---|---|---|
| 2019-01-01 00:00:00 | 2019-01-01 | 00:00:00 | 2019 | 1 | 1 | 1658.420 |
| 2019-01-01 00:30:00 | 2019-01-01 | 00:30:00 | 2019 | 1 | 1 | 1618.335 |
| 2019-01-01 01:00:00 | 2019-01-01 | 01:00:00 | 2019 | 1 | 1 | 1609.840 |
| 2019-01-01 01:30:00 | 2019-01-01 | 01:30:00 | 2019 | 1 | 1 | 1586.975 |
| 2019-01-01 02:00:00 | 2019-01-01 | 02:00:00 | 2019 | 1 | 1 | 1552.530 |
# Summary data ####
maxv <- ceiling(max(profile$r3_egt_sle)) # Get a peak MW
minv <- floor(min(profile$r3_egt_sle)) # Get a min MW
energy <- sum(profile$r3_egt_sle)/2000 # Calculate the energy
peak_day <- profile %>% #Find a peak day
group_by(year) %>%
filter(r3_egt_sle == max(r3_egt_sle)) %>%
pull(datetime)
min_day <- profile %>% #Find a min day
group_by(year) %>%
filter(r3_egt_sle == min(r3_egt_sle)) %>%
last() %>%
pull(datetime)
load_factor <- percent((energy*10^3)/(maxv*8760),
accuracy = 0.01,
decimal.mark = ".")
summary <- tibble(peak_day = peak_day,
min_day = min_day,
peak_mw = maxv,
min_mw = minv,
energy_gwh = energy,
load_factor = load_factor) # combine all data in 1 table| peak_day | min_day | peak_mw | min_mw | energy_gwh | load_factor |
|---|---|---|---|---|---|
| 2019-04-20 19:30:00 | 2019-01-05 04:00:00 | 2673 | 1309 | 17429.52 | 74.44% |
profile_plot <-
ggplot() +
geom_line(data=profile,
aes(x = datetime,
y = r3_egt_sle,
group = month,
color = as.factor(month)),
show.legend = FALSE) +
ThemeLine +
labs(x = NULL,
y = "EGAT sale to PEA R3 & direct customers (Southern region) (MW)")+
scale_x_datetime(breaks=date_breaks("1 month"),
labels=date_format("%b %y")) +
scale_y_continuous(breaks = seq(0, round(maxv,-3),1000),
limits = c(0, round(maxv, -3))) +
scale_color_manual(values = linepalette1) +
geom_point(data=summary,
aes(x = peak_day, y = peak_mw))+
geom_text(data = summary,
aes(x = peak_day, y = round(maxv, -3)),
label = glue("Peak {maxv} MW \n@ {peak_day}"),
hjust = 0.5) +
geom_point(data=summary,
aes(x = min_day, y = min_mw))+
geom_text(data = summary,
aes(x = min_day, y = round(minv, -3)*1.1),
label = glue("Minimum {minv} MW \n@ {min_day}"),
hjust = -0.05,
vjust = 0.5)
# Save the output ####
outputfigure <- paste0(outfigdir, "r3+dcr3_egtsle_2019.png")
ggsave(profile_plot, file = outputfigure, dpi = 150, width = 15, height = 5, units = "in", limitsize = FALSE)
profiledata <- c(profiledata, list("r3+dcr3_egtsle_2019" = profile))
profilefigure <- c(profilefigure, list("r3+dcr3_egtsle_2019" = profile_plot))
summarydata <- c(summarydata, list("sum_r3+dcr3_egtsle_2019" = summary))The 2019 electricity sale profile from EGAT to PEA R3 and direct customer in PEA R3 is illustrated in Figure 2.14. The electricity EGAT sale profiles of PEA R3 and direct customer in PEA R3 are illustrated in Figure 2.4 and 2.9, respectively.
Figure 2.14: EGAT electricity sale profile to PEA R3 and direct customer in PEA R3 in 2019.
2.2.7 The 2019 PEA R4 & DC R4 (Southern region) EGAT electrity sale profiles
profile <-
profiledata$pea_r4_northern_egtsle_2019%>%
mutate(dc_r4 = profiledata$dc_r4_northern_egtsle_2019$DCs_R4,
r4_egt_sle = PEA_R4 + dc_r4) %>%
select(-PEA_R4, -dc_r4)| datetime | date | time | year | month | day | r4_egt_sle |
|---|---|---|---|---|---|---|
| 2019-01-01 00:00:00 | 2019-01-01 | 00:00:00 | 2019 | 1 | 1 | 1305.854 |
| 2019-01-01 00:30:00 | 2019-01-01 | 00:30:00 | 2019 | 1 | 1 | 1252.527 |
| 2019-01-01 01:00:00 | 2019-01-01 | 01:00:00 | 2019 | 1 | 1 | 1216.315 |
| 2019-01-01 01:30:00 | 2019-01-01 | 01:30:00 | 2019 | 1 | 1 | 1167.828 |
| 2019-01-01 02:00:00 | 2019-01-01 | 02:00:00 | 2019 | 1 | 1 | 1106.570 |
# Summary data ####
maxv <- ceiling(max(profile$r4_egt_sle)) # Get a peak MW
minv <- floor(min(profile$r4_egt_sle)) # Get a min MW
energy <- sum(profile$r4_egt_sle)/2000 # Calculate the energy
peak_day <- profile %>% #Find a peak day
group_by(year) %>%
filter(r4_egt_sle == max(r4_egt_sle)) %>%
pull(datetime)
min_day <- profile %>% #Find a min day
group_by(year) %>%
filter(r4_egt_sle == min(r4_egt_sle)) %>%
last() %>%
pull(datetime)
load_factor <- percent((energy*10^3)/(maxv*8760),
accuracy = 0.01,
decimal.mark = ".")
summary <- tibble(peak_day = peak_day,
min_day = min_day,
peak_mw = maxv,
min_mw = minv,
energy_gwh = energy,
load_factor = load_factor) # combine all data in 1 table| peak_day | min_day | peak_mw | min_mw | energy_gwh | load_factor |
|---|---|---|---|---|---|
| 2019-05-20 21:30:00 | 2019-12-09 03:00:00 | 3275 | 978 | 16823.01 | 58.64% |
profile_plot <-
ggplot() +
geom_line(data=profile,
aes(x = datetime,
y = r4_egt_sle,
group = month,
color = as.factor(month)),
show.legend = FALSE) +
ThemeLine +
labs(x = NULL,
y = "EGAT sale to PEA R4 & direct customers (Northern region) (MW)")+
scale_x_datetime(breaks=date_breaks("1 month"),
labels=date_format("%b %y")) +
scale_y_continuous(breaks = seq(0, round(maxv,-3)*1.2,1000),
limits = c(0, round(maxv, -3)*1.2)) +
scale_color_manual(values = linepalette1) +
geom_point(data=summary,
aes(x = peak_day, y = peak_mw))+
geom_text(data = summary,
aes(x = peak_day, y = round(maxv, -3)*1.2),
label = glue("Peak {maxv} MW \n@ {peak_day}"),
hjust = 0.5) +
geom_point(data=summary,
aes(x = min_day, y = min_mw))+
geom_text(data = summary,
aes(x = min_day, y = round(minv, -3)*1.1),
label = glue("Minimum {minv} MW \n@ {min_day}"),
hjust = 1,
vjust = 1)
# Save the output ####
outputfigure <- paste0(outfigdir, "r4+dcr4_egtsle_2019.png")
ggsave(profile_plot, file = outputfigure, dpi = 150, width = 15, height = 5, units = "in", limitsize = FALSE)
profiledata <- c(profiledata, list("r4+dcr4_egtsle_2019" = profile))
profilefigure <- c(profilefigure, list("r4+dcr4_egtsle_2019" = profile_plot))
summarydata <- c(summarydata, list("sum_r4+dcr4_egtsle_2019" = summary))The 2019 electricity sale profile from EGAT to PEA R4 and direct customer in PEA R4 is illustrated in Figure 2.15. The electricity EGAT sale profiles of PEA R4 and direct customer in PEA R4 are illustrated in Figure 2.5 and 2.10, respectively.
Figure 2.15: EGAT electricity sale profile to PEA R4 and direct customer in PEA R4 in 2019.
2.3 The 2019 EGAT electrity sale profiles
This section provides a combined EGAT electricity sale profile. The equation is given in equation (2.4)
\[\begin{equation} $Prf_{EGTSLE,t,h}=\ Prf_{MEA,t,h} + \sum_{i=1}^{4} (Prf_{PEA,i,t,h} + Prf_{DC,i,t,h})$ \tag{2.4} \end{equation}\]
Where,
\(Prf_{EGTSLE,t,h}\) denotes the electricity EGAT sale (\(EGTSLE\)) profile (\(Prf\)) in year \(t\) at time stamp \(h\) (MW).
\(Prf_{MEA,t,h}\) denotes the electricity EGAT sale profile (\(Prf\)) to \(MEA\) in year \(t\) at time stamp \(h\) (MW).
\(Prf_{PEA,i,t,h}\) denotes the electricity EGAT sale profile (\(Prf\)) to \(PEA\) in region \(i\) in year \(t\) at time stamp \(h\) (MW).
\(Prf_{DC,i,t,h}\) denotes the electricity EGAT sale profile (\(Prf\)) to direct customer (\(DC\)) in region \(i\) in year \(t\) at time stamp \(h\) (MW).
profile <-
profiledata$mea_egtsle_2019%>%
mutate(r1_dc1 = profiledata$"r1+dcr1_egtsle_2019"$r1_egt_sle,
r2_dc2 = profiledata$"r2+dcr2_egtsle_2019"$r2_egt_sle,
r3_dc3 = profiledata$"r3+dcr3_egtsle_2019"$r3_egt_sle,
r4_dc4 = profiledata$"r4+dcr4_egtsle_2019"$r4_egt_sle,
egt_sle = MEA + r1_dc1 + r2_dc2 + r3_dc3 + r4_dc4)| datetime | date | time | year | month | day | MEA | r1_dc1 | r2_dc2 | r3_dc3 | r4_dc4 | egt_sle |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 2019-01-01 00:00:00 | 2019-01-01 | 00:00:00 | 2019 | 1 | 1 | 3361.083 | 5238.235 | 1505.430 | 1658.420 | 1305.854 | 13069.02 |
| 2019-01-01 00:30:00 | 2019-01-01 | 00:30:00 | 2019 | 1 | 1 | 3244.405 | 5109.824 | 1490.816 | 1618.335 | 1252.527 | 12715.91 |
| 2019-01-01 01:00:00 | 2019-01-01 | 01:00:00 | 2019 | 1 | 1 | 3199.672 | 5119.154 | 1422.532 | 1609.840 | 1216.315 | 12567.51 |
| 2019-01-01 01:30:00 | 2019-01-01 | 01:30:00 | 2019 | 1 | 1 | 3153.101 | 4989.641 | 1358.095 | 1586.975 | 1167.828 | 12255.64 |
| 2019-01-01 02:00:00 | 2019-01-01 | 02:00:00 | 2019 | 1 | 1 | 3085.642 | 4967.767 | 1300.803 | 1552.530 | 1106.570 | 12013.31 |
# Summary data ####
maxv <- ceiling(max(profile$egt_sle)) # Get a peak MW
minv <- floor(min(profile$egt_sle)) # Get a min MW
energy <- sum(profile$egt_sle)/2000 # Calculate the energy
peak_day <- profile %>% #Find a peak day
group_by(year) %>%
filter(egt_sle == max(egt_sle)) %>%
pull(datetime)
min_day <- profile %>% #Find a min day
group_by(year) %>%
filter(egt_sle == min(egt_sle)) %>%
last() %>%
pull(datetime)
load_factor <- percent((energy*10^3)/(maxv*8760),
accuracy = 0.01,
decimal.mark = ".")
summary <- tibble(peak_day = peak_day,
min_day = min_day,
peak_mw = maxv,
min_mw = minv,
energy_gwh = energy,
load_factor = load_factor) # combine all data in 1 table| peak_day | min_day | peak_mw | min_mw | energy_gwh | load_factor |
|---|---|---|---|---|---|
| 2019-05-02 22:30:00 | 2019-01-01 12:00:00 | 29962 | 10484 | 193469 | 73.71% |
profile_plot <-
ggplot() +
geom_line(data=profile,
aes(x = datetime,
y = egt_sle,
group = month,
color = as.factor(month)),
show.legend = FALSE) +
ThemeLine +
labs(x = NULL,
y = "EGAT sale (MEA&PEA&DCs) (MW)")+
scale_x_datetime(breaks=date_breaks("1 month"),
labels=date_format("%b %y")) +
scale_y_continuous(breaks = seq(0, round(maxv,-3)*1.1,2000),
limits = c(0, round(maxv, -3)*1.1)) +
scale_color_manual(values = linepalette1) +
geom_point(data=summary,
aes(x = peak_day, y = peak_mw))+
geom_text(data = summary,
aes(x = peak_day, y = round(maxv, -3)*1.1),
label = glue("Peak {maxv} MW \n@ {peak_day}"),
hjust = 0.5) +
geom_point(data=summary,
aes(x = min_day, y = min_mw))+
geom_text(data = summary,
aes(x = min_day, y = round(minv, -3)*1.1),
label = glue("Minimum {minv} MW \n@ {min_day}"),
hjust = -0.1,
vjust = 1)
# Save the output ####
outputfigure <- paste0(outfigdir, "egtsle_2019.png")
ggsave(profile_plot, file = outputfigure, dpi = 150, width = 15, height = 5, units = "in", limitsize = FALSE)
profiledata <- c(profiledata, list("egtsle_2019" = profile))
profilefigure <- c(profilefigure, list("egtsle_2019" = profile_plot))
summarydata <- c(summarydata, list("sum_egtsle_2019" = summary))The 2019 electricity EGAT sale profile is illustrated in Figure 2.16.
Figure 2.16: EGAT electricity sale profile 2019.